package java复习202408.C_封装继承多态验证;

import org.junit.jupiter.api.Test;

public class c1_Final关键字验证 {

    public class F1{
        public void m1(){
            System.out.println("F1的m1fangfa");
        }

        public final void m2(){
            System.out.println("F1的m2fangfa");
        }
    }

    public final class F2{
        public void m1(){
            System.out.println("F2的m1fangfa");
        }
    }

    public class F3 extends F1{
        @Override
        public void m1(){
            System.out.println("F3重写的f1的m1方法");
        }


    }

    @Test
    public void test1(){
        F1 f1 = new F1();
        F2 f2 = new F2();
        F3 f3 = new F3();
        f1.m1();
        f2.m1();
        f3.m1();
        f3.m2();
    }

}
